<div class="alert alert-success"><span class="glyphicon glyphicon-info-sign"></span> 对用户发送消息包含关键词的回复。一个规则可以对应多个关键词，匹配其中一个关键词即进行自动回复。</div>
<form action="" class="form-horizontal" role="form">

  <div class="form-group">
    <label class="col-sm-2 control-label">规则名</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" name="rule" placeholder="给此条关键字回复设置一个规则名，用来区分" datatype="*">
    </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">关键词</label>
    <div class="col-sm-3">
      <input type="text" class="form-control" name="keyword" placeholder="关键词列表，多个使用英文逗号,隔开">
      <span class="label label-info">关键词列表，多个使用英文逗号,隔开</span>
    </div>
  </div>
  
  <div class="form-group">
      <label class="col-sm-2 control-label">自动回复类型</label>
      <div class="col-sm-2">
        <select class="form-control" id="type-select" name="type" datatype="*">{$typeOptions}</select>
      </div>
  </div>
  
  <!-- 文本 -->
  <div class="form-group" id="type-text">
    <label class="col-sm-2 control-label">自动回复内容</label>
    <div class="col-sm-4 reply-txt">
      <div class="form-control" id="content" contenteditable="true"></div>
      <a class="icon-emtion" id="icon-emtion" href="javascript:void(0)"></a>
    </div>
  </div>
  
  <!-- 图文 -->
  <div class="form-group" id="type-news" style="display:none;">
    <label class="col-sm-2 control-label">自动回复内容</label>
    <div class="col-sm-5">
      <div id="news-result">
        <ul class="news-edit-lists">
        </ul>
      </div>
    </div>
  </div>
  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-8">
      <input type="hidden" name="news" id="news-id" value="">
      <button type="submit" class="btn btn-primary submit" data-loading-txt="提交中，请稍后……" data-ajax-url="__CONTROLLER__/addPost">保存更改</button>
    </div>
  </div>
</form>

<!-- 图文素材列表 -->
<section id="news">
  <ul class="news-lists" id="news-lists"></ul>
</section>

<script type="text/javascript">
  var news_data = {};
</script>
<script type="text/javascript" src="__PUBLIC__/Style/My/Default/js/getNewsLists.js"></script>
<script type="text/javascript">
  $(function(){
    $("#type-select").on("change", function(){
      var sel = $(this).val();
      if(sel == "text"){
        $("#type-news").hide();
        $("#type-text").show();
      }else if(sel == "news"){
        $("#type-text").hide();
        $("#type-news").show();
        $("#news").show();
        $MoveTools.init();
      }
    });
  });
</script>